﻿<html>

<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
	<title>Clientes</title>
</head>

<body>
	<center>
		<table border = '1px' width = '100%'>
			<?php include_once "../layout/header.php" ?>
			<tr>	
			<?php include_once "../layout/menuCliente.php" ?>	
			<td>
				<form action = "gerenciarCliente.php" method = "POST">
		
				<?php
						require_ONCE "../includes/config.inc.php";  
						$idCliente = $_GET["usr"];
						
						if($idCliente > 0){
							echo "<input type = 'hidden' name='metodo' value='atualizar'/>";
							echo "<input type = 'hidden' name='idCliente' value='" .$idCliente."'/>";
							$sql = "select * from tbCliente where idCliente = ".$idCliente.";";
							$result = mysql_query($sql);
							
							$row =  mysql_fetch_assoc($result);
							$nomeCliente = $row["nomeCliente"];
							$cpfCliente = $row["cpfCliente"];
							$rgCliente = $row["rgCliente"];
								
						}
						else{
						echo "<input type='hidden' name='metodo' value='salvar'/>";
						$nomeCliente = "";
						$cpfCliente = "";
						$rgCliente= "";
						}
					?>
					Nome: <input type="text" name="nomeCliente" value="<?php echo $nomeCliente ?>"/></br>
					CPF: <input type="text" name="cpfCliente" value="<?php echo $cpfCliente ?>"/></br>
					RG: <input type="text" name="rgCliente" value="<?php echo $rgCliente ?>"/></br>
					</br>
					<input type="submit" value="Enviar"/></br>
					<input type = "button" value = "Cancelar" onClick = "history.back();"/>
					</br>
				</form>
			
			</td>
			</tr>
				<?php include_once "../layout/footer.php" ?>
		</table>
	</center>
</body>

</html>